<template>
	<view class="consume-list-box">
		<view class="consume-list">
			<view class="consume-title">
				<image :src="imgUrl+'/consumeVal/leftIcon.png'" class="leftIcon"></image>
				<view class="consume-title-text">{{ title }}</view>
				<image :src="imgUrl+'/consumeVal/leftIcon.png'" class="leftIcon"></image>
			</view>
			<view class="consumeBlock" style="border-radius: 19rpx !important;">
					<view class="consume-list-item" v-for="(item,index) in list"
					 :class="[index==0 ? 'itemStatus':'']"
					 
					 >
						<view class="item-val">
							<text class="item-val-title">{{ item[keys.title] }}</text>
							<text class="item-val-time">{{ item[keys.time] }}</text>
						</view>
						<view :class="['item-val-num' , item[keys.type] === 1 ? '' : 'red-color']">
							{{ item[keys.type] === 1 ? '+' : '-'}}{{ item[keys.val]}}
						</view>
					</view>
			</view>
			<loadMore v-if="list.length>0 || status === 'loading'" :status="status"></loadMore>
			<nodata v-else :config="{ top: 1, content: '暂无数据~' }"></nodata>
		</view>
	</view>
</template>

<script>
	import {
		refillCardInfo
	} from "@/api/personal-center.js"
	export default {
		name: "consume-list",
		props: {
			title: {
				type: String,
				default: '',
				activeStyle:'border-bottom-left-radius: 19rpx !important;border-bottom-right-radius: 19rpx !important;'
				
			},
			keys: {
				type: Object,
				default: () => {
					return {
						title: 'remark',
						time: 'formatCreateTimeMillis',
						val: 'entryValue',
						type: 'billType'
					}
				}
			},
			status: {
				type: String,
				default: ''
			},
			list: {
				type: Array,
				default: () => {
					return []
				}
			},
		},
		data() {
			return {
				imgUrl: this.$mConfig.staticUrl,

			};
		},
		methods: {

		}
	}
</script>

<style lang="scss" scoped>
	.consume-list-box {
		width: 100%;
		position: relative;
		background: #F5F5F5;
		top: 19rpx;
	}

	.consume-list {
		width: 100%;
		position: absolute;
		background: #F5F5F5;


		.consume-title {
			font-weight: 600;
			font-size: 31rpx;
			color: #333333;
			display: flex;
			flex-direction: row;
			justify-content: center;
			align-items: center;
			width: 712rpx;
			height: 96rpx;
			border-radius: 0rpx 0rpx 0rpx 0rpx;
			margin-left: 19rpx;
			margin-bottom: 19rpx;
		}

		.consume-title-text {
			padding: 0 22rpx;
			font-size: 34rpx;
		}

		.consume-title-left {
			width: 60rpx;
			height: 4rpx;
			background: #FF721B;
			border-radius: 1px;
			position: relative;

			// &:before {
			// 	content: '';
			// 	position: absolute;
			// 	right: 0;
			// 	top: -50%;
			// 	width: 6rpx;
			// 	height: 6rpx;
			// 	background: #3775f6;
			// 	border-radius: 50%;
			// }
		}

		.consume-title-right {
			width: 60rpx;
			height: 4rpx;
			background: #FF721B;
			border-radius: 1px;
			position: relative;

			// &:before {
			// 	content: '';
			// 	position: absolute;
			// 	left: 0;
			// 	top: -50%;
			// 	width: 6rpx;
			// 	height: 6rpx;
			// 	background: #3775f6;
			// 	border-radius: 50%;
			// }
		}

		.leftIcon {
			width: 35rpx;
			height: 4rpx;
		}

		.consumeBlock {
			border-radius: 19rpx !important;
			margin-left: 19rpx;
			width: 712rpx;
		}
		

		.consume-list-item {
			width: 712rpx;
			height: 144rpx;
			background: #FFFFFF;
			border: 2rpx solid #F5F5F5;
			display: flex;
			flex-direction: row;
			justify-content: space-between;
			align-items: center;
			padding: 0 19rpx;
			box-sizing: border-box;


			.item-val {
				display: flex;
				flex-direction: column;

				.item-val-title {
					font-weight: 500;
					font-size: 29rpx;
					color: #333333;
				}

				.item-val-time {
					font-weight: 400;
					font-size: 27rpx;
					color: #999999;
					margin-top: 15rpx;
				}
			}

			.item-val-num {
				font-weight: 600;
				font-size: 35rpx;
				color: #4ACB55;
			}

			.red-color {
				color: #FF0000;
			}
		}
	}
	// .consumeBlock .consume-list-item :nth-child(1){
	// 	border-radius: 190rpx !important;
	// }
	.itemStatus{
		border-top-left-radius: 19rpx !important;
		border-top-right-radius: 19rpx !important;
	}
	.itemStatusLast{
		border-bottom-left-radius: 19rpx !important;
		border-bottom-right-radius: 19rpx !important;
	}
</style>